package com.beyeasy.tvremind;


import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper
{
	private static final String DbName = "tvremind.sqlite";

	private static int Version = 1;
	Context appContext = null;

	private static String SQLCreateTableFundCom;
	/*=	"CREATE TABLE S_FUND_COMPANY_T(" +
			"COM_ID VARCHAR(8) NOT NULL, " +
			"COM_NAME VARCHAR(100) NOT NULL, " +
			"COM_NAME_SHORT VARCHAR(40) NOT NULL, " +
			"COM_URL VARCHAR(200), " +
			"COM_TEL VARCHAR(20));";
	 */

	private static String SQLCreateTableFundName;
	/*=	"CREATE TABLE S_FUND_NAME_T(" +
			"FUND_ID VARCHAR(6) NOT NULL," +
			"FUND_NAME VARCHAR(100) NOT NULL," +
			"FUND_COM_ID VARCHAR(8)," +
			"FUND_TYPE_ID VARCHAR(3));";
	 */

	private static String SQLCreateTableFundValue;
	/*=	"CREATE TABLE F_FUND_VALUE_T(" +
			"FUND_ID VARCHAR(6) NOT NULL," +
			"VALUE_DATE VARCHAR(14) NOT NULL," +
			"VALUE REAL," +
			"VALUE_PERCENT REAL);";
	 */

	public class FundCom
	{
		public String ComID;
		public String ComNameShort;
		public String ComName;
		public String ComURL;
		public String ComTel;
	}

	public DatabaseHelper(Context context)
	{
		//super(context, DbName, null, context.getResources().getInteger(R.version.DbVersion));
		super(context, DbName, null, context.getResources().getInteger(1));
		appContext = context;
	}

	@Override
	public void onCreate(SQLiteDatabase db)
	{

		//SQLCreateTableFundCom = appContext.getString(R.string.SQLCreateTableFundCom);
		//SQLCreateTableFundName = appContext.getString(R.string.SQLCreateTableFundName);
		//SQLCreateTableFundValue = appContext.getString(R.string.SQLCreateTableFundValue);

		// TODO Auto-generated method stub
		db.execSQL(this.SQLCreateTableFundCom);
		db.execSQL(this.SQLCreateTableFundName);
		db.execSQL(this.SQLCreateTableFundValue);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
	{
		// TODO Auto-generated method stub
	}
}

